﻿@using SCMS.Resource
@model SCMS.UI.Models.SalaryPaymentItems
@{AjaxOptions ajaxOpts = new AjaxOptions
      {
          UpdateTargetId = "SPtDiv",
          LoadingElementId = "loading",
          HttpMethod = "Post",
          Url = Url.Action("SaveSPItem"),
          OnBegin = "checkBalance",
          OnSuccess = "CloseDialog()",
          OnFailure = "javascript:errormsg()"
      };}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    <input type="hidden" id="currencyId"  value="@ViewBag.CurrencyId" />
    <table>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.Global_String_ItemName:
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.EntitySalaryPBL.PayrollItemId, Model.Items, Resources.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(model => model.EntitySalaryPBL.PayrollItemId, Resources.Global_String_Required)
                @Html.HiddenFor(model => model.EntitySalaryPBL.Id)
                @Html.HiddenFor(model => model.EntitySalaryPBL.SalaryId)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.Global_String_Amount:
            </td>
            <td align="left" class="editor-field">
                @Html.TextBoxFor(model => model.EntitySalaryPBL.Amount, new { id = "TotalPrice", @class = "numericTb" })
                @Html.ValidationMessageFor(model => model.EntitySalaryPBL.Amount, Resources.Global_String_OnlyNumericRequired)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.Budget_CategoryList_ProjectNo:
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.ProjectDonorId, Model.ProjectNos, Resources.Global_String_PleaseSelect, new { @id = "dplProjectNo", onchange = "javascript:selectedIndexChange4SP(this)" })
                @Html.ValidationMessageFor(model => model.ProjectDonorId, Resources.Global_String_Required)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top" class="editor-label">
                @Resources.Budget_CreateSubLine_LineNumber:
            </td>
            <td align="left" class="editor-field">
                <div id="PBlines">
                    @Html.DropDownListFor(model => model.EntitySalaryPBL.BudgetLineId, Model.BudgetLines, Resources.Global_String_PleaseSelect, new { @class = "dpl", @id = "BudgetLineID", onchange = "javascript:checkBalance()" })
                    @Html.ValidationMessageFor(model => model.EntitySalaryPBL.BudgetLineId, Resources.Global_String_Required)
                </div>
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label" colspan="2" id="fundsCheck" valign="top">
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit" class="btn green"  value="@Resources.Global_String_Save" />&nbsp;
                <input type="button" class="btn green" value="@Resources.Global_String_Cancel" onclick="javascript:CloseDialog()" />
            </td>
        </tr>
    </table>
}